{template header}
<a href='/?c=admingear&a=setList'>返回</a>
<div class="bs-docs-example" style="clear:both;">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>名称</th>
                <th>图片</th>               
                <th>性别</th>
                <th>类别</th>
                <th>功能标签</th>
                <th>重量（克）</th>
                <th>官方售价</th>
                <th>后台评分</th>                
                <th>添加时间</th>
                <th>有效</th>
                <th width="30%">操作</th>
            </tr>
        </thead>
        <tbody>
            {loop $list $k $v}
            <tr id="{$v['gearId']}">
                <td>{$v['name']}</td>
                <td>
                    {loop $v['images'] $kk $img}
                        <img style="max-width:30px;max-height:30px;" src="{$img}">
                    {/loop}
                </td>                
                <td>{if $v['gender'] == 1}男{else}女{/if}</td>
                <td>{$v['shoeCat']}</td>
                <td>{$v['funcTag']}</td>
                <td>{$v['weight']}</td>
                <td>{if $v['currency'] == 0}￥{else}${/if}{$v['price']}</td>
                <td>{$v['score']}</td>              
                <td>{eval echo date("Y-m-d H:i:s", $v['addTime'])}</td>
                <td>{if $v['isShow'] == 1}是 {else} <span style="color:red">否</span>{/if}</td> 
                <td>
                    <a class="btn btn-edit" href="?c=admin&a=gearInfo&gearId=$v['gearId']">编辑</a>
                    <a class="btn btn-edit" href="?c=admin&a=addGearComment&gearId=$v['gearId']">加评</a>&nbsp;
                    <a class="btn btn-edit" href="?c=admin&a=gearcommentList&gearId={$v['gearId']}">查看评论</a>&nbsp;
                    <a class="btn btn-edit sc" data-gid="{$v['gearId']}">从集合中删除</a>&nbsp;
                </td>
            </tr>
            {/loop}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
<input type='hidden' id='sid' value="{$setId}">
<script type="text/javascript">
$('.sc').on('click',function(){
    var sid=$('#sid').val();
    var gid=$(this).attr('data-gid');
    $.ajax({
        url:"/admingear/delfromset",
        type:"post",
        data:{gid:gid,sid:sid},
        success:function(res){
            if(res){
             location.href=''
            }
        }
    })

})
</script>
{template footer}
